Section 3.5.5.3
Cylindrical Lights

Cylindrical light sources work pretty much like spotlights except that the light rays are constraint by a cylinder and not a cone. Their syntax is:

light_source { <CENTER> color <COLOUR> cylinder point_at <POINT> radius RADIUS falloff FALLOFF tightness TIGHTNESS [ looks_like { OBJECT } ] [ fade_distance FADE_DISTANCE ] [ fade_power FADE_POWER ] [ atmospheric_attenuation BOOL ] }

The radius, falloff and tightness keywords control the same features as with the spotlight.

You should keep in mind that the cylindrical light source is still a point light source. The rays emit from one point and are only constraint by a cylinder. The light rays are not parallel.


Section 3.5.5.4
Area Lights

Area light sources occupy a finite area of space. They can cast soft shadows because they can partially block light.

The area lights used in POV-Ray are rectangular in shape, sort of like a flat panel light. Rather than performing the complex calculations that would be required to model a true area light, it is approximated as an array of "point" light sources spread out over the area occupied by the light. The intensity of each individual point light in the array is dimmed so that the total amount of light emitted by the light is equal to the light color specified in the declaration. It's syntax is:

light_source { <CENTER> color <COLOUR> area_light <AXIS1>, <AXIS2>, SIZE1, SIZE2 adaptive ADAPTIVE jitter JITTER [ spotlight ] [ point_at <POINT> ] [ radius RADIUS ] [ falloff FALLOFF ] [ tightness TIGHTNESS ] [ looks_like { OBJECT } ] [ fade_distance FADE_DISTANCE ] [ fade_power FADE_POWER ] [ atmospheric_attenuation BOOL ] }

The light's location and color are specified in the same way as a regular light source.

The area_light command defines the size and orientation of the area light as well as the number of lights in the light source array. The vectors AXIS1 and AXIS2 specify the lengths and directions of the edges of the light. Since the area lights are rectangular in shape these vectors should be perpendicular to each other. The larger the size of the light the thicker that the soft part of the shadow will be. The numbers SIZE1 and SIZE2 specify the dimensions of the array of point lights. The larger the number of lights you use the smoother your shadows will be but the longer they will take to render.

The adaptive command is used to enable adaptive sampling of the light source. By default POV-Ray calculates the amount of light that reaches a surface from an area light by shooting a test ray at every point light within the array. As you can imagine this is very slow. Adaptive sampling on the other hand attempts to approximate the same calculation by using a minimum number of test rays. The number specified after the keyword controls how much adaptive sampling is used. The higher the number the more accurate your shadows will be but the longer they will take to render. If you're not sure what value to use a good starting point is 'adaptive 1'. The adaptive command only accepts integer values and cannot be set lower than 0. Adaptive sampling is explained in more detail later.

The jitter command is optional. When used it causes the positions of the point lights in the array to be randomly jittered to eliminate any shadow banding that may occur. The jittering is completely random from render to render and should not be used when generating animations.

Note: It's possible to specify spotlight parameters along with area_light parameters to create "area spotlights." Using area spotlights is a good way to speed up scenes that use area lights since you can confine the lengthy soft shadow calculations to only the parts of your scene that need them.

An interesting effect that can be created using area lights as a linear light. Rather than having a rectangular shape, a linear light stretches along a line sort of like a thin fluorescent tube. To create a linear light just create an area light with one of the array dimensions set to 1.

When performing adaptive sampling POV-Ray starts by shooting a test ray at each of the four corners of the area light. If the amount of light received from all four corners is approximately the same then the area light is assumed to be either fully in view or fully blocked. The light intensity is then calculated as the average intensity of the light received from the four corners. However, if the light intensity from the four corners differs significantly then the area light is partially blocked. The light is the split into four quarters and each section is sampled as described above. This allows POV-Ray to rapidly approximate how much of the area light is in view without having to shoot a test ray at every light in the array.

While the adaptive sampling method is fast (relatively speaking) it can sometimes produces inaccurate shadows. The solution is to reduce the amount of adaptive sampling without completely turning it off. The number after the adaptive keyword adjusts the number of times that the area light will be split before the adaptive phase begins. For example if you use "adaptive 0" a minimum of 4 rays will be shot at the light. If you use "adaptive 1" a minimum of 9 rays will be shot (adaptive 2 = 25 rays, adaptive 3 = 81 rays, etc).

Visually the pattern goes like this:


Area light adaptive samples.

Obviously the more shadow rays you shoot the slower the rendering will be so you should use the lowest value that gives acceptable results.

The number of rays never exceeds the values you specify for rows and columns of points. For example: area_light x,y,4,4 specifies a 4 by 4 array of lights. If you specify adaptive 3 it would mean that you should start with a 9 by 9 array. In this case no adaptive sampling is done. The 4 by 4 array is used.


Section 3.5.5.5
Shadowless

Using the "shadowless" keyword you can stop a light source from casting shadows.

Section 3.5.5.6
Looks_like

Normally the light source itself has no visible shape. The light simply radiates from an invisible point or area. You may give a light source a any shape by adding a "looks_like {OBJECT }" statement.

There is an implied "no_shadow" attached to the looks_like object so that light is not blocked by the object. Without the automatic no_shadow, the light inside the object would not escape. The object would, in effect, cast a shadow over everything.

If you want the attached object to block light then you should attach it with a union and not a looks_like as follows:

union { light_source {<100,200,-300> color White} object {My_Lamp_Shade} }

Presumably parts of the lamp shade are translucent to let some light out.


Section 3.5.5.7
Light Fading

By default POV-Ray does not diminish light from any light source as it travels through space. In order to get a more realistic effect "fade_distance" and "fade_power" can be used to model the distance based falloff in light intensity.

The "fade_distance" keyword is used to specify the distance at which the full light intensity arrives, i.e. the intensity which was given by the "color" keyword. The actual attenuation is described by the "fade_power" keyword, which determines the falloff rate. E.g. Linear or quadratic falloff can be used by setting FADE_POWER to 1 or 2 respectively. The complete formula to calculate the factor by which the light is attenuated is:

                                 2
  attenuation = --------------------------------------,
                 1 + (d / FADE_DISTANCE) ^ FADE_POWER

with d being the distance the light has traveled.

You should note two important facts: First, for FADE_DISTANCEs larger than 1 the light intensity at distances smaller than FADE_DISTANCE actually increases. This is necessary to get the light source color at distance FADE_DISTANCE. Second, only light coming directly from light sources is attenuated. Reflected or refracted light is not attenuated by distance.


Section 3.5.5.8
Atmospheric Attenuation

Normally light coming from light sources is not influenced by fog or atmosphere. This behavior can be changed by turning the atmospheric attenuation for a given light source on. All light coming from this light source will now be diminished as it travels through fog or atmosphere. This results in an distance-based, exponential intensity falloff ruled by the used fog or atmosphere. If there is no fog or atmosphere no change will be seen.

Section 3.5.6
Object Modifiers

A variety of modifiers may be attached to objects. Transformations such as translate, rotate and scale have already been discussed. Textures are in a section of their own below. Here are three other important modifiers: clipped_by, bounded_by and no_shadow. Although the examples below use object statements and object identifiers, these modifiers may be used on any type of object such as sphere, box etc.

Section 3.5.6.1
Clipped_By

The "clipped_by" statement is technically an object modifier but it provides a type of CSG similar to CSG intersection. You attach a clipping object like this:

object { My_Thing clipped_by{plane{y,0}} }

Every part of the object "My_Thing" that is inside the plane is retained while the remaining part is clipped off and discarded. In an intersection object, the hole is closed off. With clipped_by it leaves an opening. For example this diagram shows our object "A" being clipped_by a plane {y,0}.


A cylinder clipped by a box.

Clipped_by may be used to slice off portions of any shape. In many cases it will also result in faster rendering times than other methods of altering a shape.

Often you will want to use the clipped_by and bounded_by options with the same object. The following shortcut saves typing and uses less memory.

object { My_Thing bounded_by{box{<0,0,0>,<1,1,1>}} clipped_by{bounded_by} }

This tells POV-Ray to use the same box as a clip that was used as a bounds.


Section 3.5.6.2
Bounded_By

The calculations necessary to test if a ray hits an object can be quite time consuming. Each ray has to be tested against every object in the scene. POV-Ray attempts so speed up the process by building a set of invisible boxes, called bounding boxes, which cluster the objects together. This way a ray that travels in one part of the scene doesn't have to be tested against objects in another far away part of the scene. When large number objects are present the boxes are nested inside each other. POV-Ray can use bounding boxes on any finite object and even some clipped or bounded quadrics. However infinite objects (such as a planes, quartic, cubic and poly) cannot be automatically bound. CSG objects are automatically bound if they contain finite (and in some cases even infinite) objects. This works by applying the CSG set operations to the bounding boxes of all objects used inside the CSG object. For difference and intersection operations this will hardly ever lead to an optimal bounding box. It's sometimes better (depending on the complexity of the CSG object) to use a bounded_by statement with such shapes.

Normally bounding shapes are not necessary but there are cases where they can be used to speed up the rendering of complex objects. Bounding shapes tell the ray tracer that the object is totally enclosed by a simple shape. When tracing rays, the ray is first tested against the simple bounding shape. If it strikes the bounding shape, then the ray is further tested against the more complicated object inside. Otherwise the entire complex shape is skipped, which greatly speeds rendering.

To use bounding shapes, simply include the following lines in the declaration of your object:

bounded_by { object { ... } }

An example of a Bounding Shape:

intersection { sphere {<0,0,0>, 2} plane {<0,1,0>, 0} plane {<1,0,0>, 0} bounded_by {sphere {<0,0,0>, 2}} }

The best bounding shape is a sphere or a box since these shapes are highly optimized, although, any shape may be used. If the bounding shape is itself a finite shape which responds to bounding slabs then the object which it encloses will also be used in the slab system.

CSG shapes can benefit from bounding slabs without a bounded_by statement however they may do so inefficiently in intersection, difference and merge. In these three CSG types the automatic bound used covers all of the component objects in their entirety. However the result of these intersections may result in a smaller object. Compare the sizes of the illustrations for union and intersection in the CSG section above. It is possible to draw a much smaller box around the intersection of A and B than the union of A and B yet the automatic bounds are the size of union {A B} regardless of the kind of CSG specified.

While it is almost always a good idea to manually add a bounded_by to intersection, difference and merge, it is often best to NOT bound a union. If a union has no bounded_by and no clipped_by then POV-Ray can internally split apart the components of a union and apply automatic bounding slabs to any of its finite parts. Note that some utilities such as RAW2POV may be able to generate bounds more efficiently than POV-Ray's current system. However most unions you create yourself can be easily bounded by the automatic system. For technical reasons POV-Ray cannot split a merge object. It is probably best to hand bound a merge, especially if it is very complex.

Note that if bounding shape is too small or positioned incorrectly, it may clip the object in undefined ways or the object may not appear at all. To do true clipping, use clipped_by as explained above. Often you will want to use the clipped_by and bounded_by options with the same object. The following shortcut saves typing and uses less memory.

object { My_Thing clipped_by{box{<0,0,0>,<1,1,1>}} bounded_by{clipped_by} }

This tells POV-Ray to use the same box as a bounds that was used as a clip.


Section 3.5.6.3
Hollow

POV-Ray by default assumes that objects are made of a solid material that completely fills the interior of an object. By adding the "hollow" keyword to the object you can make it hollow.

The "hollow" keyword is very useful if you want atmospheric effects to exist inside an object. It is even required for objects containing a halo.


Section 3.5.6.4
No_Shadow

You may specify the no_shadow keyword in an object and that object will not cast a shadow. This is useful for special effects and for creating the illusion that a light source actually is visible. This keyword was necessary in earlier versions of POV-Ray which did not have the "looks_like" statement. Now it is useful for creating things like laser beams or other unreal effects.

Simply attach the keyword as follows:

object { My_Thing no_shadow }
Next Section
Table Of Contents